function get(url,data){
  return new Promise((resolv,reject)=>{
    wx.request({
      url: url,
      data:data,
      method:'GET',
      success(res){
        resolv(res)
      },
      fail(res){
        reject(res)
      }
    })
  })
}
function post(url,data){
  return new Promise((resolv,reject)=>{
    wx.request({
      url: url,
      data:data,
      method:'POST',
      header:{
        'content-type':'application/x-www-form-urlencoded'
      },
      dataType: 'json', // 添加这个配置
      success(res){
        resolv(res)
      },
      fail(res){
        reject(res)
      }
    })
  })
  
}

export default{
  get,
  post
}